package cn.credit.loan.service.card;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.credit.loan.dao.card.CardMapper;
import cn.credit.loan.entity.Card;
@Service
@Transactional
public class CardServiceImpl implements CardService {
	@Autowired
	public CardMapper cardMapper;
	
	/**
	 * 卡通添加
	 */
	@Override
	public boolean getCardadd(Card card) throws Exception {
		if(card!=null)
		{
			int num=cardMapper.getCardadd(card);
			if(num>0)
			{
				return true;
			}
			
		}
		return false;
	}
	/**
	 * 卡通更新
	 */
	@Override
	public boolean getCardupdate(Card card) throws Exception {
		if(card!=null)
		{
			int num=cardMapper.getCardupdate(card);
			if(num>0)
			{
				return true;
			}
			
		}
		return false;
	}
	/**
	 * 卡通删除
	 */
	@Override
	public boolean getCarddelete(int cardId) throws Exception {
		return cardMapper.getCarddelete(cardId);
	}
	/**
	 * 卡通查询
	 */
	@Override
	public List<Card> getCardList(Card card) throws Exception {
	
			List<Card> cardlist=cardMapper.getCardList(card);
			if(cardlist!=null)
			{
				return cardlist;
			}
	
		
		return null;
	}

}
